package com.tj.collection.enums;

/**
 * Author: Karl
 * Date: 2020/12/17 6:21 下午
 */
public enum ClUserMarriageEnum {

    NOT_MARRIED(0, "Unmarried"),
    MARRIED_AND_PROCREATED(1, "Married but childless"),
    MARRIED_AND_NOT_PROCREATED(2, "Married with children"),
    DIVORCED_OR_WIDOWED(3, "Divorced/Widowed");

    private Integer type;
    private String desc;

    ClUserMarriageEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public ClUserMarriageEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public ClUserMarriageEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static ClUserMarriageEnum getEnum(Integer type) {
        for (ClUserMarriageEnum enumObj : ClUserMarriageEnum.values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj;
            }
        }
        return null;
    }
}
